unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    ButtonTWX: TButton;
    ButtonMX: TButton;
    ButtonTWY: TButton;
    ButtonMY: TButton;
    Label1: TLabel;
    Button1: TButton;
    RichEdit1: TRichEdit;
    procedure ButtonTWXClick(Sender: TObject);
    procedure ButtonMXClick(Sender: TObject);
    procedure ButtonMYClick(Sender: TObject);
    procedure ButtonTWYClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ButtonTWXClick(Sender: TObject);
var
  i,iX1,iX2,iY1,iY0 : Integer;
  sText,sColor : string;
begin
  iX1 := 154;
  iX2 := 700;
//  iY1 := 183;
  iY0 := 205;

  Memo1.Lines.Clear;
  for i :=0 to 34 do
  begin
    sColor := 'clSilver';
    if i  mod 5 =0 then
    begin
      sColor := 'clGray';
      Memo1.Lines.Add('');
    end;

    iY1 := iY0 + i * 13;

    sText := Format('(B:(X:%d;Y:%d);E:(X:%d;Y:%d);Color:%s),',[iX1,iY1,iX2,iY1,sColor]);
    Memo1.Lines.Add(sText);

  end;


end;

procedure TForm1.ButtonMXClick(Sender: TObject);
var
  i,iX1,iX2,iY1,iY0 : Integer;
  sText,sColor : string;
begin
  iX1 := 56;
  iX2 := 700;
  iY1 := 780;
  iY0 := 780;

  Memo1.Lines.Clear;
  for i :=0 to 11 do
  begin
    sColor := 'clSilver';

    iY1 := iY0 + i * 18;

    sText := Format('(B:(X:%d;Y:%d);E:(X:%d;Y:%d);Color:%s),',[iX1,iY1,iX2,iY1,sColor]);
    Memo1.Lines.Add(sText);
  end;

end;

procedure TForm1.ButtonMYClick(Sender: TObject);
var
  i,iX1,iX0,iY1,iY2 : Integer;
  sText,sColor : string;
begin
  iX1 := 154;
  iX0 := 154;
  iY1 := 110;
  iY2 := 1120;

  Memo1.Lines.Clear;
  for i :=1 to 6 do
  begin
    sColor := 'clRed';

    iX1 := iX0 + i * 78;

    sText := Format('(B:(X:%d;Y:%d);E:(X:%d;Y:%d);Color:%s),',[iX1,iY1,iX1,iY2,sColor]);
    Memo1.Lines.Add(sText);
  end;

end;

procedure TForm1.ButtonTWYClick(Sender: TObject);
var
  i,iX1,iX0,iY1,iY2 : Integer;
  sText,sColor : string;
begin
  iX1 := 154;
  iX0 := 154;
  iY1 := 150;
  iY2 := 865;

  Memo1.Lines.Clear;
  for i :=0 to 41 do
  begin
    sColor := 'clSilver';
    if i  mod 6 =0 then
    begin
      Memo1.Lines.Add('');
      Continue;
    end;

    iX1 := iX0 + i * 13;

    sText := Format('(B:(X:%d;Y:%d);E:(X:%d;Y:%d);Color:%s),',[iX1,iY1,iX1,iY2,sColor]);
    Memo1.Lines.Add(sText);

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i,iX,iY,iIndex : Integer;
  sText,sFont,sSJ : string;
const
  SJ : array[0..5] of string = ('2','6','10','2','6','10');
  Font : array[0..5] of string = ('tfSJR','tfSJR','tfSJB','tfSJB','tfSJB','tfSJR');
begin
  //
  iY := 165;
  Memo1.Lines.Clear;
  for i := 0 to 41 do
  begin
    iIndex := i  mod 6;
    sSJ := SJ[iIndex];
    sFont := Font[iIndex];

    if iIndex =0 then
      Memo1.Lines.Add('');

    if sSJ='10' then
      iX := 158 + (i-1) * 13 + 9
    else
      iX := 158 + i * 13;

    sText := Format('    (P:(X:%d;Y:%d);Text:''%s'';Font:%s),',[iX,iY,sSJ,sFont]);
    Memo1.Lines.Add(sText);



  end;



end;

end.
